<!DOCTYPE html>
<html lang="en">
    <head>
    <title>MQ and PubSub - Tinusgraglin</title>
    
    
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1"><meta name="description" content="A Slice MQ and PubSub How are they different?"/><meta name="keywords" content="thoughts-on-topic, pub-sub, mq" />
    <meta property="og:title" content="A Slice of Tgl -&nbsp;MQ and PubSub" />
    <meta property="og:type" content="website"/><meta property="og:url" content="&#x2F;blog&#x2F;mq-pubsub&#x2F;"/><meta property="og:description" content="How are they different?"/>
    <link rel="preload" href="/blog/assets/fonts/FiraCode-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
    <link rel="preload" href="/blog/assets/fonts/FiraCode-Bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">

    <link rel="stylesheet" href="/blog/style.css?h=97e262212a0704163528">
    <link rel="stylesheet" href=" /blog/color/orange.css?h=a5a5d7faf9d4bc3e0b18">
    
</head>
    <body>
        <div class="container center">
<header class="header">
    <div class="header__inner">
        <div class="header__logo">
            <a href="&#x2F;blog">
    <div class="logo">
        LIN
    </div>
</a>
        </div>
        <div class="menu-trigger">menu</div>
    </div>
    
    <nav class="menu">
        <ul class="menu__inner menu__inner--desktop">
            
            
                    <li>
                        <a href="
    
        /blog/about
    
">about</a>
                    </li>
                
            </ul>

        <ul class="menu__inner menu__inner--mobile">
            
        <li>
            <a href="
    
        /blog/about
    
">about</a>
        </li>
        </ul>
    </nav>

    </header>
<div class="content"><article class="post">
        <header>
            <h1 class="post-title">
                <a href="&#x2F;blog&#x2F;mq-pubsub&#x2F;">MQ and PubSub</a>
            </h1>
            
    <div class="post-meta">
        <span class="post-date">2023.03.14
                </span>

        <span class="post-author"></span>

        

    
    :: {<a href="/blog/categories/thoughts-on-topic/">thoughts-on-topic</a>} 

            
    ::
    #<a href="/blog/tags/pub-sub/">pub-sub</a>
        
    #<a href="/blog/tags/mq/">mq</a>
        
    
            
        
    </div>

            
    
</header><p>We focus on two massage passing paradigms: Message Queue and Pub-Sub.</p>
<p>The way I understand it, the major part of a message queue is just, literally, a queue
of message, the control logic may pessimistically wait for message consumers or actively
forwards it, either way, to make sure a message is not lost forever, it needs acknowledgements
from consumers.</p>
<p>For pub-sub, it is just like how the mail newspaper works: you order newspaper of your
choice and have your mailbox setup, and newspaper press produce the content of a piece
of newspaper and have somebody copy it and deliver one to everyone subscribes it.</p>
<p>For example, say the 'somebody' just receives a new issue of Today's Waterfall from
Waterfall Local Press and finds that only Alice and Bob wants to read Today's Waterfall,
so he/she make a copy and send it first to Alice and send the original copy to Bob,
later he/she receives a new issue of The Guardian from the City Press and finds Alice,
Mike and Tom wants it, he/she again make two copy of newly received The Guardian and send
it to Alice and Mike and send the original to Tom.</p>
<p>Now assume these people are all on vacations and not home, the 'somebody' has to pile
newspapers inside/in front of their mailboxes/front doors.</p>
<p>Inside Alice's mailbox lies first Today's Waterfall, and then the Guardian, following the
order the 'somebody' receive them.</p>
<p><img src="/blog/mq-pubsub/./pubsub.svg" alt="pub-sub-of-newspaper" /></p>


        
    

        
        
    </article></div>
    <div class="pagination">
        <div class="pagination__buttons">
            </div>
    </div>
<footer class="footer">
                    <div class="footer__inner"><div class="copyright">
            <span>© 2024 Tinusgraglin <span/>
            <span>:: Powered by <a href="https://www.getzola.org/">Zola</a>(<a href="https://www.rust-lang.org/">Rust</a>) and <a href="https://bun.sh">Bun</a>(<a href="https://ziglang.org">Zig</a>)</span>
        </div>
    <script type="text/javascript" src="/blog/assets/js/main.js"></script>
</div>
                    

                </footer></div>
    </body>
</html>
